home *** CD-ROM | disk | FTP | other *** search
-
- CUSERID(3) UNIX Programmer's Manual CUSERID(3)
-
- NNAAMMEE
- ccuusseerriidd - get user name
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssttddiioo..hh>>
-
- _c_h_a_r _*
- ccuusseerriidd(_c_h_a_r _*_b_u_f)
-
- DDEESSCCRRIIPPTTIIOONN
- TThhiiss iinntteerrffaaccee iiss aavvaaiillaabbllee ffrroomm tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt..
-
- The ccuusseerriidd() function returns a character string representation of the
- user name associated with the effective user ID of the calling process.
-
- If _b_u_f is not the NULL pointer, the user name is copied into the memory
- referenced by _b_u_f. The argument _b_u_f is assumed to point to an array at
- least L_cuserid (as defined in the include file <_s_t_d_i_o_._h>) bytes long.
- Otherwise, the user name is copied to a static buffer.
-
- RREETTUURRNN VVAALLUUEESS
- If _b_u_f is not the NULL pointer, _b_u_f is returned; otherwise the address of
- the static buffer is returned.
-
- If the user name could not be determined, if _b_u_f is not the NULL pointer,
- the null character `\0' will be stored at _*_b_u_f; otherwise the NULL point-
- er is returned.
-
- SSEEEE AALLSSOO
- getlogin(2), getpwent(3)
-
- SSTTAANNDDAARRDDSS
- The ccuusseerriidd() function conforms to IEEE Std1003.1-1988 (``POSIX'').
-
- BBUUGGSS
- Due to irreconcilable differences in historic implementations, ccuusseerriidd()
- was removed from the standard. This implementation exists purely for
- compatibility with existing programs. New programs should use one of the
- following three alternatives to obtain the user name:
-
- 1. ggeettllooggiinn() to return the user's login name.
- 2. ggeettppwwuuiidd(ggeetteeuuiidd()) to return the user name associated with
- the calling process' effective user ID.
- 3. ggeettppwwuuiidd(ggeettuuiidd()) to return the user name associated with the
- calling process' real user ID.
-
- The ccuusseerriidd() function uses ggeettppwwuuiidd(); thus the results of a user's call
- to ggeettppwweenntt(), ggeettppwwnnaamm() or ggeettppwwuuiidd() will be overwritten by subsequent
- calls to ccuusseerriidd().
-
- BSD Experimental November 28, 1993 1
-